package com.blankland.dataanalysis.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 伽马设备表
 * @TableName sess_gamma_device
 */
@TableName(value ="sess_gamma_device")
@Data
public class Device implements Serializable {
    /**
     * 主键
     */
    @TableId(type = IdType.AUTO)
    private Long deviceId;

    /**
     * 设备名称
     */
    private String deviceName;

    /**
     * 设备编码
     */
    private String deviceCode;

    /**
     *
     */
    private Date createTime;

    /**
     *
     */
    private String createBy;

    /**
     *
     */
    private Date updateTime;

    /**
     *
     */
    private String updateBy;

    /**
     * 启动 停止
     */
    private String state;

    /**
     * 钾40对应的能量
     */
    private Double k40Energy;

    /**
     * 钾40对应的道址
     */
    private Integer k40Channel;

    /**
     * 铊208对应的能量
     */
    private Double ti208Energy;

    /**
     * 铊208对应的道址
     */
    private Integer ti208Channel;

    /**
     * 钾40和铊208对应的k
     */
    private Double k;

    /**
     * 钾40和铊208对应的b
     */
    private Double b;

    @TableField(exist = false) //数据表不存在
    private Long gammaDataNum; //接收到谱线数据
    @TableField(exist = false)
    private Long gammaDataAnalyseNum;//解析的谱线数据
    @TableField(exist = false)
    private Long gammaDataNoAnalyseNum;//未解析的谱线数据


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Device other = (Device) that;
        return (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getDeviceName() == null ? other.getDeviceName() == null : this.getDeviceName().equals(other.getDeviceName()))
            && (this.getDeviceCode() == null ? other.getDeviceCode() == null : this.getDeviceCode().equals(other.getDeviceCode()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
            && (this.getK40Energy() == null ? other.getK40Energy() == null : this.getK40Energy().equals(other.getK40Energy()))
            && (this.getK40Channel() == null ? other.getK40Channel() == null : this.getK40Channel().equals(other.getK40Channel()))
            && (this.getTi208Energy() == null ? other.getTi208Energy() == null : this.getTi208Energy().equals(other.getTi208Energy()))
            && (this.getTi208Channel() == null ? other.getTi208Channel() == null : this.getTi208Channel().equals(other.getTi208Channel()))
            && (this.getK() == null ? other.getK() == null : this.getK().equals(other.getK()))
            && (this.getB() == null ? other.getB() == null : this.getB().equals(other.getB()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode());
        result = prime * result + ((getDeviceCode() == null) ? 0 : getDeviceCode().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
        result = prime * result + ((getK40Energy() == null) ? 0 : getK40Energy().hashCode());
        result = prime * result + ((getK40Channel() == null) ? 0 : getK40Channel().hashCode());
        result = prime * result + ((getTi208Energy() == null) ? 0 : getTi208Energy().hashCode());
        result = prime * result + ((getTi208Channel() == null) ? 0 : getTi208Channel().hashCode());
        result = prime * result + ((getK() == null) ? 0 : getK().hashCode());
        result = prime * result + ((getB() == null) ? 0 : getB().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", deviceId=").append(deviceId);
        sb.append(", deviceName=").append(deviceName);
        sb.append(", deviceCode=").append(deviceCode);
        sb.append(", createTime=").append(createTime);
        sb.append(", createBy=").append(createBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", state=").append(state);
        sb.append(", k40Energy=").append(k40Energy);
        sb.append(", k40Channel=").append(k40Channel);
        sb.append(", ti208Energy=").append(ti208Energy);
        sb.append(", ti208Channel=").append(ti208Channel);
        sb.append(", k=").append(k);
        sb.append(", b=").append(b);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
